package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.TableColumn;
import com.william.jdbcplus.common.annotation.TableId;
import com.william.jdbcplus.common.annotation.TableName;
import com.william.jdbcplus.common.annotation.TableUk;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("db_h")
@ApiModel("h表")
public class H extends Entity {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", remarks = "主键", type = IdType.GUID)
    private String id;

    // 外键关联非主键时，主表字段必须有唯一性约束, 字段长度类型必须一致
    @TableColumn(value = "code", remarks = "编码", size = 60)
    @TableUk
    private String code;
}
